home *** CD-ROM | disk | FTP | other *** search
Text File | 1997-02-01 | 48.2 KB | 2,347 lines | [TEXT/CWIE] |
- /*
- Well, this is a quick hack.
- The code is very sloppy, but it does what it should do
- The theory here is to pick mostly numbers that have come up one time
- in the last ten times. The rest of the numbers are randomized.
-
- Earl Schellhous
- */
-
- #include <iostream.h>
- #include <iomanip.h>
- #include <stdio.h>
- #include <stdlib.h>
- #include <time.h>
-
- #include "lottowhiz.h"
- int seed = 0;
- time_t *curtime = 0;
-
-
-
- void main(void)
- {
- // our all-purpose indexes
- int index, index1, index2;
- int count = 0;
- int count2 = 0;
- int count3 = 0;
- int setnum = 0;
- int pickwin = 0;
- char instring[100] = {0x00};
- char tempstring[10] = {0x00};
-
-
-
- cout << "Enter the last 10 Lotto Draws." << endl;
- cout << "IMPORTANT!: start with the last draw first!!" << endl;
- cout << "Use the form number <dot> number <dot>." << endl;
- cout << "The entry of numbers is easy using the keypad and enter key!" << endl;
- cout << "Example: 11.14.15.28.29.47 ( no period on the end )." << endl;
- cout << "There is limited editing and saving" << endl << endl;
- cout << "This program will generate 5 numbers to use in the next draw!" << endl;
- cout << "You can use your printer to print out the stats and results!" << endl;
- cout << "If you don't like the sets of numbers, try it again!!" << endl;
- cout << endl << endl << endl;
-
- // this sets up the array of pointers to structs
- for( index = 0; index < 10; index++ )
- {
- array[index] = new struct lottonum;
- array[index]->odds = 0;
- array[index]->evens = 0;
- array[index]->reds = 0;
- array[index]->whites = 0;
- array[index]->blues = 0;
- array[index]->average = 0;
- array[index]->sum_of_diffs = 0;
-
-
- switch( index )
- {
- case 0:
- {
- array[index]->next = array[index + 1];
- array[index]->prev = 0;
- } break;
-
- case 9:
- {
- array[index]->prev = array[index - 1];
- array[index]->next = 0;
- } break;
-
- default:
- {
- array[index]->next = array[index + 1];
- array[index]->prev = array[index - 1];
- } break;
-
- }
- }
-
- for(count3 = 0; count3 < 10; count3++ )
- {
- cin >> instring;
- count = 0;
- count2 = 0;
- setnum = 0;
- int increment = 0;
-
- do {
- increment = 0;
- while( (instring[count] != '.') && (instring[count] != 0) )
- {
- tempstring[increment] = instring[count];
- increment++;
- count++;
- }
-
- array[count3]->set[setnum] = atoi( tempstring );
-
- if( setnum < 7 )
- {
- while( count2 < 10 )
- {
- tempstring[count2] = 0x00;
- count2++;
- }
- count++;
- count2 = 0;
- }
- setnum++;
-
- } while( instring[count] != '0x00' && setnum < 6 );
-
- int hold1 = 0; // simple bubble sort here
-
-
- for( int pass1 = 0; pass1 < 10; pass1++ )
- {
- for( int pass2 = 0; pass2 < 6; pass2++ )
- {
- for( int d = 0; d < (6 - 1); d++ )
- {
- if( array[pass1]->set[d] > array[pass1]->set[d+1] )
- {
- hold1 = array[pass1]->set[d];
- array[pass1]->set[d] = array[pass1]->set[d + 1];
- array[pass1]->set[d + 1] = hold1;
- }
- }
- }
- }
-
-
- cout << "Set Number " << count3 + 1 << " is: "
- << array[count3]->set[0] << ' '
- << array[count3]->set[1] << ' '
- << array[count3]->set[2] << ' '
- << array[count3]->set[3] << ' '
- << array[count3]->set[4] << ' '
- << array[count3]->set[5] << ' '
- << endl;
- }
-
-
- // this counts the occurrances of numbers in the sets
- // count_array[]:
- // 0 is ommitted to make count_array easier to understand
- // 52 is ommitted to make room for the NULL terminator in count_array
- for( index1 = 0; index1 < 10; index1++ )
- {
- for( index2 = 0; index2 < 6; index2++ )
- {
- switch( array[index1]->set[index2] )
- {
- case 1:
- {
- count_array[1]++;
- array[index1]->odds++;
- array[index1]->reds++;
- } continue;
-
- case 2:
- {
- count_array[2]++;
- array[index1]->evens++;
- array[index1]->reds++;
- } continue;
-
- case 3:
- {
- count_array[3]++;
- array[index1]->odds++;
- array[index1]->reds++;
- } continue;
-
- case 4:
- {
- count_array[4]++;
- array[index1]->evens++;
- array[index1]->reds++;
- } continue;
-
- case 5:
- {
- count_array[5]++;
- array[index1]->odds++;
- array[index1]->reds++;
- } continue;
-
- case 6:
- {
- count_array[6]++;
- array[index1]->evens++;
- array[index1]->reds++;
- } continue;
-
- case 7:
- {
- count_array[7]++;
- array[index1]->odds++;
- array[index1]->reds++;
- } continue;
-
- case 8:
- {
- count_array[8]++;
- array[index1]->evens++;
- array[index1]->reds++;
- } continue;
-
- case 9:
- {
- count_array[9]++;
- array[index1]->odds++;
- array[index1]->reds++;
- } continue;
-
- case 10:
- {
- count_array[10]++;
- array[index1]->evens++;
- array[index1]->reds++;
- } continue;
-
- case 11:
- {
- count_array[11]++;
- array[index1]->odds++;
- array[index1]->reds++;
- } continue;
-
- case 12:
- {
- count_array[12]++;
- array[index1]->evens++;
- array[index1]->reds++;
- } continue;
-
- case 13:
- {
- count_array[13]++;
- array[index1]->odds++;
- array[index1]->reds++;
- } continue;
-
- case 14:
- {
- count_array[14]++;
- array[index1]->evens++;
- array[index1]->reds++;
- } continue;
-
- case 15:
- {
- count_array[15]++;
- array[index1]->odds++;
- array[index1]->reds++;
- } continue;
-
- case 16:
- {
- count_array[16]++;
- array[index1]->evens++;
- array[index1]->reds++;
- } continue;
-
- case 17:
- {
- count_array[17]++;
- array[index1]->odds++;
- array[index1]->reds++;
- } continue;
- // end of reds
- case 18:
- {
- count_array[18]++;
- array[index1]->evens++;
- array[index1]->whites++;
- } continue;
-
- case 19:
- {
- count_array[19]++;
- array[index1]->odds++;
- array[index1]->whites++;
- } continue;
-
- case 20:
- {
- count_array[20]++;
- array[index1]->evens++;
- array[index1]->whites++;
- } continue;
-
- case 21:
- {
- count_array[21]++;
- array[index1]->odds++;
- array[index1]->whites++;
- } continue;
-
- case 22:
- {
- count_array[22]++;
- array[index1]->evens++;
- array[index1]->whites++;
- } continue;
-
- case 23:
- {
- count_array[23]++;
- array[index1]->odds++;
- array[index1]->whites++;
- } continue;
-
- case 24:
- {
- count_array[24]++;
- array[index1]->evens++;
- array[index1]->whites++;
- } continue;
-
- case 25:
- {
- count_array[25]++;
- array[index1]->odds++;
- array[index1]->whites++;
- } continue;
-
- case 26:
- {
- count_array[26]++;
- array[index1]->evens++;
- array[index1]->whites++;
- } continue;
-
- case 27:
- {
- count_array[27]++;
- array[index1]->odds++;
- array[index1]->whites++;
- } continue;
-
- case 28:
- {
- count_array[28]++;
- array[index1]->evens++;
- array[index1]->whites++;
- } continue;
-
- case 29:
- {
- count_array[29]++;
- array[index1]->odds++;
- array[index1]->whites++;
- } continue;
-
- case 30:
- {
- count_array[30]++;
- array[index1]->evens++;
- array[index1]->whites++;
- } continue;
-
- case 31:
- {
- count_array[31]++;
- array[index1]->odds++;
- array[index1]->whites++;
- } continue;
-
- case 32:
- {
- count_array[32]++;
- array[index1]->evens++;
- array[index1]->whites++;
- } continue;
-
- case 33:
- {
- count_array[33]++;
- array[index1]->odds++;
- array[index1]->whites++;
- } continue;
-
- case 34:
- {
- count_array[34]++;
- array[index1]->evens++;
- array[index1]->whites++;
- } continue;
- // end of whites
- case 35:
- {
- count_array[35]++;
- array[index1]->odds++;
- array[index1]->blues++;
- } continue;
-
- case 36:
- {
- count_array[36]++;
- array[index1]->evens++;
- array[index1]->blues++;
- } continue;
-
- case 37:
- {
- count_array[37]++;
- array[index1]->odds++;
- array[index1]->blues++;
- } continue;
-
- case 38:
- {
- count_array[38]++;
- array[index1]->evens++;
- array[index1]->blues++;
- } continue;
-
- case 39:
- {
- count_array[39]++;
- array[index1]->odds++;
- array[index1]->blues++;
- } continue;
-
- case 40:
- {
- count_array[40]++;
- array[index1]->evens++;
- array[index1]->blues++;
- } continue;
-
- case 41:
- {
- count_array[41]++;
- array[index1]->odds++;
- array[index1]->blues++;
- } continue;
-
- case 42:
- {
- count_array[42]++;
- array[index1]->evens++;
- array[index1]->blues++;
- } continue;
-
- case 43:
- {
- count_array[43]++;
- array[index1]->odds++;
- array[index1]->blues++;
- } continue;
-
- case 44:
- {
- count_array[44]++;
- array[index1]->evens++;
- array[index1]->blues++;
- } continue;
-
- case 45:
- {
- count_array[45]++;
- array[index1]->odds++;
- array[index1]->blues++;
- } continue;
-
- case 46:
- {
- count_array[46]++;
- array[index1]->evens++;
- array[index1]->blues++;
- } continue;
-
- case 47:
- {
- count_array[47]++;
- array[index1]->odds++;
- array[index1]->blues++;
- } continue;
-
- case 48:
- {
- count_array[48]++;
- array[index1]->evens++;
- array[index1]->blues++;
- } continue;
-
- case 49:
- {
- count_array[49]++;
- array[index1]->odds++;
- array[index1]->blues++;
- } continue;
-
- case 50:
- {
- count_array[50]++;
- array[index1]->evens++;
- array[index1]->blues++;
- } continue;
-
- case 51:
- {
- count_array[51]++;
- array[index1]->odds++;
- array[index1]->blues++;
- } continue;
-
- default: break;
- }
- }
- }
-
- cout << endl << endl;
- cout << "Here are the statistics on the ten previous draws: " << endl << endl;
- int index4;
- for( index4 = 0; index4 < 10; index4++ )
- {
- cout << "Set " << index4 + 1;
- if( (index4 + 1) < 10 ) cout << ' ';
- cout << " odds = " << array[index4]->odds
- << " evens = " << array[index4]->evens
- << " whites = " << array[index4]->whites
- << " blues = " << array[index4]->blues
- << " reds = " << array[index4]->reds
- << endl;
- }
-
- cout << endl << endl;
- cout << "The number distribution is: " << endl;
- int index5;
- for( index5 = 1; index5 < 52; index5++ ) // on count_array, 0 and 52 are omitted
- {
- cout << "Number ";
- if( index5 < 10 ) cout << ' ';
- cout << index5 << " = " << count_array[index5] << " ";
- if( (index5 % 5) == 0 ) cout << endl;
- }
-
- cout << endl << endl << endl;
-
- cout << "The number distributions as sets are: " << endl;
- cout << "( Don't be mislead, only data from the last ten sets are used here!!! )" << endl;
- cout << "Only compare the numbers of 1's here with the numbers of 0's on the new set!!" << endl;
- for( int pez1 = 0; pez1 < 10; pez1++ )
- {
- cout << "Set #";
- if( (pez1 + 1) < 10 ) cout << ' ';
- cout << (pez1 + 1) << " = ";
- for( int pez2 = 0; pez2 < 6; pez2++ )
- {
- cout << (count_array[(array[pez1]->set[pez2])]) << ' ';
- }
- cout << endl;
- }
-
- cout << endl << endl;
-
-
- int index6;
- int temp;
- for( index6 = 0; index6 < 10; index6++ )
- {
- temp = 0;
- temp += (array[index6]->set[1] - array[index6]->set[0]);
- temp += (array[index6]->set[2] - array[index6]->set[1]);
- temp += (array[index6]->set[3] - array[index6]->set[2]);
- temp += (array[index6]->set[4] - array[index6]->set[3]);
- temp += (array[index6]->set[5] - array[index6]->set[4]);
-
- array[index6]->sum_of_diffs = temp;
-
- cout << "Number Set ";
- if( (index6 + 1) < 10 ) cout << ' ';
- cout << index6 + 1 << " sum of differences = ";
- if( array[index6]->sum_of_diffs < 10 ) cout << ' ';
- cout << array[index6]->sum_of_diffs << endl;
-
- }
-
- cout << endl;
-
- int index7;
- for( index7 = 0; index7 < 10; index7++ )
- {
- float sum = 0;
- int summer = 0;
-
- for( summer = 0; summer < 6; summer++ )
- {
- sum += array[index7]->set[summer];
- }
- array[index7]->average = (( sum / 6 ) + .5);
- cout << "The average of Number Set ";
- if( (index7 + 1) < 10 ) cout << ' ';
- cout << index7 + 1 << " is: ";
- if( array[index7]->average < 10 ) cout << ' ';
- cout << array[index7]->average << endl;
- }
-
- /****************** END OF ORIGINAL NUMBER SET CALCULATIONS ***************************/
-
-
-
-
-
-
- // clear out the temporary buffer
- for( int phase1 = 0; phase1 < 10; phase1++ )
- {
- for( int phase2 = 0; phase2 < 6; phase2++ )
- {
- nums[phase1][phase2] = 0;
- }
- }
-
- // seed the rand
- seed = time( curtime );
- srand( seed );
-
- int ind1 = 0;
- int ind2 = 0;
- int pick1 = 0;
- int getnum = 0;
- int quit = 0;
-
- for( ind2 = 0; ind2 < 10; ind2++ ) // ********* START OF GENERATE NEW NUMBERS
- {
- for( ind1 = 0; ind1 < 6; ind1++ )
- {
- do {
- pick1 = ( 1 + rand() % 18 );
- }while( pick1 < 1 || pick1 > 18 );
-
- switch( pick1 )
- {
- case 1: // get a 1 distrib.
- {
- while( count_array[getnum] != 1 && quit < 100 )
- {
- do {
- getnum = (1 + rand() % 51);
- }while( getnum < 1 || getnum > 51 );
- quit++;
- }
- if( count_array[getnum] == 1 )
- {
- nums[ind2][ind1] = getnum;
- } else {
- nums[ind2][ind1] = ( 1 + rand() % 51 );
- }
- getnum = 0;
- quit = 0;
- } break;
-
- case 2: // get a red
- {
- while( getnum < 1 || getnum > 17 )
- {
- getnum = (1 + rand() % 17);
- }
- if( getnum > 0 && getnum < 18 )
- {
- nums[ind2][ind1] = getnum;
- } else {
- nums[ind2][ind1] = ( 1 + rand() % 51 );
- }
- getnum = 0;
- } break;
-
- case 3: // get a 0 distrib.
- {
- while( count_array[getnum] != 0 && quit < 100 )
- {
- getnum = ( 1 + rand() % 51 );
- quit++;
- }
- if( count_array[getnum] == 0 )
- {
- nums[ind2][ind1] = getnum;
- } else {
- nums[ind2][ind1] = ( 1 +rand() % 51 );
- }
- getnum = 0;
- quit = 0;
- } break;
-
- case 4: // get a white
- {
- while( getnum < 18 || getnum > 34 )
- {
- getnum = rand() % 34;
- }
- if( getnum > 17 && getnum < 35 )
- {
- nums[ind2][ind1] = getnum;
- } else {
- nums[ind2][ind1] = ( 1 + rand() % 51 );
- }
- getnum = 0;
- } break;
-
- case 5: // get a 1 distrib.
- {
- while( count_array[getnum] != 1 && quit < 100 )
- {
- getnum = ( 1 + rand() % 51 );
- quit++;
- }
- if( count_array[getnum] == 1 )
- {
- nums[ind2][ind1] = getnum;
- } else {
- nums[ind2][ind1] = ( 1 + rand() % 51 );
- }
- getnum = 0;
- quit = 0;
- } break;
-
- case 6: // get a 0 distrib.
- {
- while( count_array[getnum] != 0 && quit < 100 )
- {
- getnum = ( 1 + rand() % 51 );
- quit++;
- }
- if( count_array[getnum] == 0 )
- {
- nums[ind2][ind1] = getnum;
- } else {
- nums[ind2][ind1] = ( 1 +rand() % 51 );
- }
- getnum = 0;
- quit = 0;
- } break;
-
- case 7: // get a two dist
- {
- while( count_array[getnum] != 2 && quit < 100 )
- {
- getnum = ( 1 + rand() % 51 );
- quit++;
- }
- if( count_array[getnum] == 2 )
- {
- nums[ind2][ind1] = getnum;
- } else {
- nums[ind2][ind1] = ( 1 + rand() % 51 );
- }
- getnum = 0;
- quit = 0;
- } break;
-
- case 8: // get a white
- {
- while( getnum < 18 || getnum > 34 )
- {
- getnum = rand() % 34;
- }
- if( getnum > 17 && getnum < 35 )
- {
- nums[ind2][ind1] = getnum;
- } else {
- nums[ind2][ind1] = ( 1 + rand() % 51 );
- }
- getnum = 0;
- } break;
-
- case 9: // get a 4 distrib.
- {
- while( count_array[getnum] != 4 && quit < 100 )
- {
- getnum = ( 1 + rand() % 51 );
- quit++;
- }
- if( count_array[getnum] == 4 )
- {
- nums[ind2][ind1] = getnum;
- } else {
- nums[ind2][ind1] = ( 1 + rand() % 51 );
- }
- getnum = 0;
- quit = 0;
- } break;
-
- case 10: // get a red
- {
- while( getnum < 1 || getnum > 17 )
- {
- getnum = rand() % 17;
- }
- if( getnum > 0 && getnum < 18 )
- {
- nums[ind2][ind1] = getnum;
- } else {
- nums[ind2][ind1] = ( 1 + rand() % 51 );
- }
- getnum = 0;
- } break;
-
- case 11: // get one of the numbers from the last draw
- {
- int something = 0;
- while( something < 1 || something > 6 )
- {
- something = ( 1 + rand() % 6 );
- }
- nums[ind2][ind1] = array[0]->set[something - 1];
- } break;
-
- case 12: // get a three dist.
- {
- while( count_array[getnum] != 3 && quit < 100 )
- {
- getnum = ( 1 + rand() % 51 );
- quit++;
- }
- if( count_array[getnum] == 3 )
- {
- nums[ind2][ind1] = getnum;
- } else {
- nums[ind2][ind1] = ( 1 + rand() % 51 );
- }
- getnum = 0;
- quit = 0;
- } break;
-
- case 13: // get one from the next to last draw
- {
- int something = 0;
- while( something < 1 || something > 6 )
- {
- something = ( 1 + rand() % 6 );
- }
- nums[ind2][ind1] = array[1]->set[something - 1];
- } break;
-
- case 14: // get a 1 dist
- {
- while( count_array[getnum] != 1 && quit < 100 )
- {
- do {
- getnum = (1 + rand() % 51);
- }while( getnum < 1 || getnum > 51 );
- quit++;
- }
- if( count_array[getnum] == 1 )
- {
- nums[ind2][ind1] = getnum;
- } else {
- nums[ind2][ind1] = ( 1 + rand() % 51 );
- }
- getnum = 0;
- quit = 0;
- } break;
-
- case 15: // get one from the third to the last draw
- {
- int something = 0;
- while( something < 1 || something > 6 )
- {
- something = ( 1 + rand() % 6 );
- }
- nums[ind2][ind1] = array[2]->set[something - 1];
- } break;
-
- case 16: // get a two dist
- {
- while( count_array[getnum] != 2 && quit < 100 )
- {
- getnum = rand() % 51;
- quit++;
- }
- if( count_array[getnum] == 0 )
- {
- nums[ind2][ind1] = getnum;
- } else {
- nums[ind2][ind1] = ( 1 + rand() % 51 );
- }
- getnum = 0;
- quit = 0;
- } break;
-
- case 17: // get a one dist
- {
- while( count_array[getnum] != 1 && quit < 100 )
- {
- do {
- getnum = (1 + rand() % 51);
- }while( getnum < 1 || getnum > 51 );
- quit++;
- }
- if( count_array[getnum] == 1 )
- {
- nums[ind2][ind1] = getnum;
- } else {
- nums[ind2][ind1] = ( 1 + rand() % 51 );
- }
- getnum = 0;
- quit = 0;
- } break;
-
- case 18: // get a 0 distrib.
- {
- while( count_array[getnum] != 0 && quit < 100 )
- {
- getnum = ( 1 + rand() % 51 );
- quit++;
- }
- if( count_array[getnum] == 0 )
- {
- nums[ind2][ind1] = getnum;
- } else {
- nums[ind2][ind1] = ( 1 +rand() % 51 );
- }
- getnum = 0;
- quit = 0;
- } break;
-
- default:
- {
- break;
- }
-
- }
- if( nums[ind2][0] == 0 )
- {
- while( nums[ind2][ind1] < 1 || nums[ind2][ind1] > 17 )
- {
- nums[ind2][ind1] = ( 1 + rand() % 17 ); // just get a rand
- }
- getnum = 0;
- quit = 0;
- } else {
- if( nums[ind2][ind1] == 0 )
- {
- while( nums[ind2][ind1] < 1 || nums[ind2][ind1] > 51 )
- {
- nums[ind2][ind1] = ( 1 + rand() % 51 ); // just get a rand
- }
- getnum = 0;
- quit = 0;
- }
- }
- }
- }
-
-
- // cycle through the numbers checking for out - of - parameters
-
- int ind3 = 0;
- int ind4 = 0;
- int anum = 0;
- int lastnum = 0;
- int do_again = 1;
-
- // this do while loop should not let any duplicates or out-of-params slip through
- do {
- do_again = 0; // start with 0 then change to one when a correction is made
-
- for( ind4 = 0; ind4 < 10; ind4++ )
- {
- for( ind3 = 0; ind3 < 6; ind3++ )
- {
- if( nums[ind4][ind3] < 1 || nums[ind4][ind3] > 51 || nums[ind4][ind3] == 0 )
- {
- nums[ind4][ind3] = ( 1 + rand() % 51 );
- do_again = 1;
- }
- }
- }
-
-
- // check for duplicates
- for( int pass3 = 0; pass3 < 10; pass3++ ) // check 0 against 1 - 5
- {
- for( int pass4 = 1; pass4 < 6; pass4++ )
- {
- if( nums[pass3][0] == nums[pass3][pass4] )
- {
- nums[pass3][pass4] =( 1 + rand() % 51 );
- do_again = 1;
- }
- }
- }
-
- for( int pass5 = 0; pass5 < 10; pass5++ ) // check 1 agaainst 2 - 5
- {
- for( int pass6 = 2; pass6 < 6; pass6++ )
- {
- if( nums[pass5][1] == nums[pass5][pass6] )
- {
- nums[pass5][pass6] = ( 1 + rand() % 51 );
- do_again = 1;
- }
- }
- }
-
- for( int pass7 = 0; pass7 < 10; pass7++ ) // check 2 against 3 - 5
- {
- for( int pass8 = 3; pass8 < 6; pass8++ )
- {
- if( nums[pass7][2] == nums[pass7][pass8] )
- {
- nums[pass7][pass8] = ( 1 + rand() % 51 );
- do_again = 1;
- }
- }
- }
-
- for( int pass9 = 0; pass9 < 10; pass9++ ) // check 3 against 4 - 5
- {
- for( int pass10 = 4; pass10 < 6; pass10++ )
- {
- if( nums[pass9][3] == nums[pass9][pass10] )
- {
- nums[pass9][pass10] = ( 1 + rand() % 51 );
- do_again = 1;
- }
- }
- }
-
- for( int pass11 = 0; pass11 < 10; pass11++ ) // check 4 against 5
- {
- if( nums[pass11][4] == nums[pass11][5] )
- {
- nums[pass11][5] = ( 1 + rand() % 51 );
- do_again = 1;
- }
- }
-
- // cycle through the numbers checking for out - of - parameters
- ind3 = 0;
- ind4 = 0;
- anum = 0;
- lastnum = 0;
-
- for( ind4 = 0; ind4 < 10; ind4++ )
- {
- for( ind3 = 0; ind3 < 6; ind3++ )
- {
- if( nums[ind4][ind3] < 1 || nums[ind4][ind3] > 51 || nums[ind4][ind3] == 0 )
- {
- nums[ind4][ind3] = ( 1 + rand() % 51 );
- do_again = 1;
- }
- }
- }
- } while( do_again == 1 ); // if any corrections made, do it again
-
- // end of do_again loop
- // this sets up the array of pointers to structs
- for( index = 0; index < 10; index++ )
- {
- array2[index] = new struct lottonum2;
- array2[index]->odds2 = 0;
- array2[index]->evens2 = 0;
- array2[index]->reds2 = 0;
- array2[index]->whites2 = 0;
- array2[index]->blues2 = 0;
- array2[index]->average2 = 0;
- array2[index]->sum_of_diffs2 = 0;
- array2[index]->use = 0;
-
-
- switch( index )
- {
- case 0:
- {
- array2[index]->next2 = array2[index + 1];
- array2[index]->prev2 = 0;
- } break;
-
- case 9:
- {
- array2[index]->prev2 = array2[index - 1];
- array2[index]->next2 = 0;
- } break;
-
- default:
- {
- array2[index]->next2 = array2[index + 1];
- array2[index]->prev2 = array2[index - 1];
- } break;
-
- }
- }
-
- // load the array into the second struct
- for( int iter1 = 0; iter1 < 10; iter1++ )
- {
- for( int iter2 = 0; iter2 < 6; iter2++ )
- {
- array2[iter1]->set2[iter2] = nums[iter1][iter2];
- }
- }
-
- int hold3 = 0; // another simple bubble sort here
-
-
- for( int pass17 = 0; pass17 < 10; pass17++ )
- {
- for( int pass18 = 0; pass18 < 6; pass18++ )
- {
- for( int d3 = 0; d3 < (6 - 1); d3++ )
- {
- if( array2[pass17]->set2[d3] > array2[pass17]->set2[d3+1] )
- {
- hold3 = array2[pass17]->set2[d3];
- array2[pass17]->set2[d3] = array2[pass17]->set2[d3 + 1];
- array2[pass17]->set2[d3 + 1] = hold3;
- }
- }
- }
- }
-
-
-
-
- int pickanum = 0;
-
- for(int x1 = 0; x1 < 5; x1++ ) // try an initial group of five sets
- {
- pickanum = 0;
-
- do {
- pickanum = rand() % 15;
- } while( pickanum < 1 || pickanum > 9 || (array2[pickanum]->use == 1) );
-
- array2[pickanum]->use = 1;
-
- }
-
-
- int fixit = 0;
- int somenum = 0;
- int redoctr = 0;
- int toomany = 0;
-
- // try to make sure we have at least one set with equal odds & evens
- int need3odd = 1; // true until we prove it false
-
- redo:
-
- // this counts the occurrances of numbers in the sets
- // count_array2[]:
- // 0 is ommitted to make count_array easier to understand
- // 52 is ommitted to make room for the NULL terminator in count_array
- index1 = 0;
- index2 = 0; // just to be sure
- for( int razz1 = 0; razz1 < 52; razz1++ )
- {
- count_array2[razz1] = NULL;
- }
-
- for( int razz4 = 0; razz4 < 10; razz4++ )
- {
- array2[razz4]->odds2 = NULL;
- array2[razz4]->evens2 = NULL;
- array2[razz4]->reds2 = NULL;
- array2[razz4]->whites2 = NULL;
- array2[razz4]->blues2 = NULL;
- }
-
- for( index1 = 0; index1 < 10; index1++ )
- {
- for( index2 = 0; index2 < 6; index2++ )
- {
- switch( array2[index1]->set2[index2] )
- {
- case 1:
- {
- count_array2[1]++;
- array2[index1]->odds2++;
- (array2[index1]->reds2++);
- } continue;
-
- case 2:
- {
- count_array2[2]++;
- array2[index1]->evens2++;
- (array2[index1]->reds2++);
- } continue;
-
- case 3:
- {
- count_array2[3]++;
- array2[index1]->odds2++;
- (array2[index1]->reds2++);
- } continue;
-
- case 4:
- {
- count_array2[4]++;
- array2[index1]->evens2++;
- (array2[index1]->reds2++);
- } continue;
-
- case 5:
- {
- count_array2[5]++;
- array2[index1]->odds2++;
- (array2[index1]->reds2++);
- } continue;
-
- case 6:
- {
- count_array2[6]++;
- array2[index1]->evens2++;
- (array2[index1]->reds2++);
- } continue;
-
- case 7:
- {
- count_array2[7]++;
- array2[index1]->odds2++;
- (array2[index1]->reds2++);
- } continue;
-
- case 8:
- {
- count_array2[8]++;
- array2[index1]->evens2++;
- (array2[index1]->reds2++);
- } continue;
-
- case 9:
- {
- count_array2[9]++;
- array2[index1]->odds2++;
- (array2[index1]->reds2++);
- } continue;
-
- case 10:
- {
- count_array2[10]++;
- array2[index1]->evens2++;
- (array2[index1]->reds2++);
- } continue;
-
- case 11:
- {
- count_array2[11]++;
- array2[index1]->odds2++;
- (array2[index1]->reds2++);
- } continue;
-
- case 12:
- {
- count_array2[12]++;
- array2[index1]->evens2++;
- (array2[index1]->reds2++);
- } continue;
-
- case 13:
- {
- count_array2[13]++;
- array2[index1]->odds2++;
- (array2[index1]->reds2++);
- } continue;
-
- case 14:
- {
- count_array2[14]++;
- array2[index1]->evens2++;
- (array2[index1]->reds2++);
- } continue;
-
- case 15:
- {
- count_array2[15]++;
- array2[index1]->odds2++;
- (array2[index1]->reds2++);
- } continue;
-
- case 16:
- {
- count_array2[16]++;
- array2[index1]->evens2++;
- (array2[index1]->reds2++);
- } continue;
-
- case 17:
- {
- count_array2[17]++;
- array2[index1]->odds2++;
- (array2[index1]->reds2++);
- } continue;
- // end of reds
- case 18:
- {
- count_array2[18]++;
- array2[index1]->evens2++;
- (array2[index1]->whites2++);
- } continue;
-
- case 19:
- {
- count_array2[19]++;
- array2[index1]->odds2++;
- (array2[index1]->whites2++);
- } continue;
-
- case 20:
- {
- count_array2[20]++;
- array2[index1]->evens2++;
- (array2[index1]->whites2++);
- } continue;
-
- case 21:
- {
- count_array2[21]++;
- array2[index1]->odds2++;
- (array2[index1]->whites2++);
- } continue;
-
- case 22:
- {
- count_array2[22]++;
- array2[index1]->evens2++;
- (array2[index1]->whites2++);
- } continue;
-
- case 23:
- {
- count_array2[23]++;
- array2[index1]->odds2++;
- (array2[index1]->whites2++);
- } continue;
-
- case 24:
- {
- count_array2[24]++;
- array2[index1]->evens2++;
- (array2[index1]->whites2++);
- } continue;
-
- case 25:
- {
- count_array2[25]++;
- array2[index1]->odds2++;
- (array2[index1]->whites2++);
- } continue;
-
- case 26:
- {
- count_array2[26]++;
- array2[index1]->evens2++;
- (array2[index1]->whites2++);
- } continue;
-
- case 27:
- {
- count_array2[27]++;
- array2[index1]->odds2++;
- (array2[index1]->whites2++);
- } continue;
-
- case 28:
- {
- count_array2[28]++;
- array2[index1]->evens2++;
- (array2[index1]->whites2++);
- } continue;
-
- case 29:
- {
- count_array2[29]++;
- array2[index1]->odds2++;
- (array2[index1]->whites2++);
- } continue;
-
- case 30:
- {
- count_array2[30]++;
- array2[index1]->evens2++;
- (array2[index1]->whites2++);
- } continue;
-
- case 31:
- {
- count_array2[31]++;
- array2[index1]->odds2++;
- (array2[index1]->whites2++);
- } continue;
-
- case 32:
- {
- count_array2[32]++;
- array2[index1]->evens2++;
- (array2[index1]->whites2++);
- } continue;
-
- case 33:
- {
- count_array2[33]++;
- array2[index1]->odds2++;
- (array2[index1]->whites2++);
- } continue;
-
- case 34:
- {
- count_array2[34]++;
- array2[index1]->evens2++;
- (array2[index1]->whites2++);
- } continue;
- // end of whites
- case 35:
- {
- count_array2[35]++;
- array2[index1]->odds2++;
- (array2[index1]->blues2++);
- } continue;
-
- case 36:
- {
- count_array2[36]++;
- array2[index1]->evens2++;
- (array2[index1]->blues2++);
- } continue;
-
- case 37:
- {
- count_array2[37]++;
- array2[index1]->odds2++;
- (array2[index1]->blues2++);
- } continue;
-
- case 38:
- {
- count_array2[38]++;
- array2[index1]->evens2++;
- (array2[index1]->blues2++);
- } continue;
-
- case 39:
- {
- count_array2[39]++;
- array2[index1]->odds2++;
- (array2[index1]->blues2++);
- } continue;
-
- case 40:
- {
- count_array2[40]++;
- array2[index1]->evens2++;
- (array2[index1]->blues2++);
- } continue;
-
- case 41:
- {
- count_array2[41]++;
- array2[index1]->odds2++;
- (array2[index1]->blues2++);
- } continue;
-
- case 42:
- {
- count_array2[42]++;
- array2[index1]->evens2++;
- (array2[index1]->blues2++);
- } continue;
-
- case 43:
- {
- count_array2[43]++;
- array2[index1]->odds2++;
- (array2[index1]->blues2++);
- } continue;
-
- case 44:
- {
- count_array2[44]++;
- array2[index1]->evens2++;
- (array2[index1]->blues2++);
- } continue;
-
- case 45:
- {
- count_array2[45]++;
- array2[index1]->odds2++;
- (array2[index1]->blues2++);
- } continue;
-
- case 46:
- {
- count_array2[46]++;
- array2[index1]->evens2++;
- (array2[index1]->blues2++);
- } continue;
-
- case 47:
- {
- count_array2[47]++;
- array2[index1]->odds2++;
- (array2[index1]->blues2++);
- } continue;
-
- case 48:
- {
- count_array2[48]++;
- array2[index1]->evens2++;
- (array2[index1]->blues2++);
- } continue;
-
- case 49:
- {
- count_array2[49]++;
- array2[index1]->odds2++;
- (array2[index1]->blues2++);
- } continue;
-
- case 50:
- {
- count_array2[50]++;
- array2[index1]->evens2++;
- (array2[index1]->blues2++);
- } continue;
-
- case 51:
- {
- count_array2[51]++;
- array2[index1]->odds2++;
- (array2[index1]->blues2++);
- } continue;
-
- default: break;
- }
- }
- }
-
- do {
- fixit = 0;
- for( int apass1 = 0; apass1 < 10; apass1++ ) // cycle thru all 10
- {
- if( array2[apass1]->use == 1 ) // look for a selected one
- {
- for( int apass2 = 0; apass2 < 10; apass2++ ) // cycle thru ten again
- {
- if( array2[apass2]->use == 1 && apass1 != apass2 ) // if it is selected ...
- { // and is not the same one
- for( int apass3 = 0; apass3 < 6; apass3++ ) // look through six of the first
- {
- for( int apass4 = 0; apass4 < 6; apass4++ ) // check against 6 of second
- {
- if( array2[apass1]->set2[apass3] == array2[apass2]->set2[apass4] )
- {
- do {
- somenum = 0;
- somenum = (1 + rand() % 51);
- } while( somenum < 1 || somenum > 51 );
- array2[apass1]->set2[apass3] = somenum;
- fixit = 1;
- }
- }
- }
- }
- }
- }
- }
- } while( fixit == 1 );
-
-
-
- // load the second struct into the array
- for( int iter1 = 0; iter1 < 10; iter1++ )
- {
- for( int iter2 = 0; iter2 < 6; iter2++ )
- {
- nums[iter1][iter2] = array2[iter1]->set2[iter2];
- }
- }
-
- // cycle through the numbers checking for out - of - parameters
-
- ind3 = 0;
- ind4 = 0;
- anum = 0;
- lastnum = 0;
- do_again = 1;
-
- // this do while loop should not let any duplicates or out-of-params slip through
- do {
- do_again = 0; // start with 0 then change to one when a correction is made
-
-
-
- // check for duplicates
- for( int pass3 = 0; pass3 < 10; pass3++ ) // check 0 against 1 - 5
- {
- for( int pass4 = 1; pass4 < 6; pass4++ )
- {
- if( nums[pass3][0] == nums[pass3][pass4] )
- {
- nums[pass3][pass4] = ( 1 + rand() % 51 );
- do_again = 1;
- }
- }
- }
-
- for( int pass5 = 0; pass5 < 10; pass5++ ) // check 1 agaainst 2 - 5
- {
- for( int pass6 = 2; pass6 < 6; pass6++ )
- {
- if( nums[pass5][1] == nums[pass5][pass6] )
- {
- nums[pass5][pass6] = ( 1 + rand() % 51 );
- do_again = 1;
- }
- }
- }
-
- for( int pass7 = 0; pass7 < 10; pass7++ ) // check 2 against 3 - 5
- {
- for( int pass8 = 3; pass8 < 6; pass8++ )
- {
- if( nums[pass7][2] == nums[pass7][pass8] )
- {
- nums[pass7][pass8] = ( 1 + rand() % 51 );
- do_again = 1;
- }
- }
- }
-
- for( int pass9 = 0; pass9 < 10; pass9++ ) // check 3 against 4 - 5
- {
- for( int pass10 = 4; pass10 < 6; pass10++ )
- {
- if( nums[pass9][3] == nums[pass9][pass10] )
- {
- nums[pass9][pass10] = ( 1 + rand() % 51 );
- do_again = 1;
- }
- }
- }
-
- for( int pass11 = 0; pass11 < 10; pass11++ ) // check 4 against 5
- {
- if( nums[pass11][4] == nums[pass11][5] )
- {
- nums[pass11][5] = ( 1 + rand() % 51 );
- do_again = 1;
- }
- }
-
- } while( do_again == 1 ); // if any corrections made, do it again
-
- // load the array into the second struct
- for( int iter1 = 0; iter1 < 10; iter1++ )
- {
- for( int iter2 = 0; iter2 < 6; iter2++ )
- {
- array2[iter1]->set2[iter2] = nums[iter1][iter2];
- }
- }
-
-
- int again = 0;
-
- do {
- again = 0;
- for( int ant1 = 0; ant1 < 10; ant1++ )
- {
- if( array2[ant1]->use == 1 )
- {
- for( int ant2 = 0; ant2 < 10; ant2++ )
- {
- if( array2[ant1]->set2[0] == array2[ant2]->set2[0] && ant1 != ant2 )
- {
- again = 1;
- do {
- array2[ant2]->set2[0] = ( 1 + rand() % (array2[ant2]->set2[1]) );
- } while( (array2[ant2]->set2[0]) < 0 ||
- (array2[ant2]->set2[0]) > (array2[ant2]->set2[1]) );
- }
- }
- }
- }
- } while( again == 1 );
-
-
- for( int pas1 = 0; pas1 < 10; pas1++ )
- {
- if( array2[pas1]->odds2 == 3 && array2[pas1]->use == 1 )
- {
- need3odd = 0; // yay! one of our chosen works, no need to try another
- toomany++;
- break;
- } else {
- need3odd = 1; // nope, got to find one
- }
- if( need3odd == 0 ) break; // if we got to here & it's 0, we found one ... get out of loop
- }
-
- int newtry = 20; // just so we know we haven't got it yet..
- if( need3odd == 1 ) // we need to find one...
- {
- for( int pas2 = 0; pas2 < 10; pas2++ )
- {
- if( array2[pas2]->use == 0 && array2[pas2]->odds2 == 3 && toomany < 2 )
- {
- do {
- do {
- newtry = ( rand() % 9 );
- } while( newtry < 0 || newtry > 9 );
- if( array2[newtry]->use != 1 ) newtry = 20; // random find a used one
- } while( newtry == 20 );
- if( array2[newtry]->use == 1 ) // make sure we got a used one
- {
- array2[newtry]->use = 0;
- array2[pas2]->use = 1;
- need3odd = 0;
- newtry = 20;
- break; // no need to break
- }
- }
- }
- }
-
- if( need3odd == 1 && redoctr <= 2 ) // try 2 times to find an even number of odds & evens
- {
- redoctr++;
- goto redo; // try to make sure we don't have any matching numbers in the set
- }
-
-
- int bluescnt = 0;
-
- for( int blu1 = 0; blu1 < 10; blu1++ )
- {
- if( (array2[blu1]->blues2 > 2) && (array2[blu1]->use == 1) )
- {
- bluescnt++;
- }
- }
-
- if( bluescnt > 2 )
- {
- do {
- for( int blu2 = 0; blu2 < 10; blu2++ )
- {
- if( (array2[blu2]->use == 1) && (array2[blu2]->blues2 > 2) )
- {
- for( int blu3 = 0; blu3 < 6; blu3++ )
- {
- if( array2[blu2]->set2[blu3] > 34 && (array2[blu2]->blues2 > 2) )
- {
- if( (blu3 % 2) == 0 )
- {
- do {
- array2[blu2]->set2[blu3] = (1 + rand() % 17);
- } while( (array2[blu2]->set2[blu3] < 0) ||
- (array2[blu2]->set2[blu3] > 17) );
- array2[blu2]->blues2--;
- }
-
- if( (blu3 % 2) == 1 )
- {
- do {
- array2[blu2]->set2[blu3] = (1 + rand() % 34);
- } while( (array2[blu2]->set2[blu3] < 18) ||
- (array2[blu2]->set2[blu3] > 34) );
- array2[blu2]->blues2--;
- }
- }
- }
- bluescnt--;
- }
- }
- } while( bluescnt > 2 );
- }
-
- for( int last1 = 0; last1 < 10; last1++ )
- {
- if( array2[last1]->use == 0 )
- {
- for( int last2 = 0; last2 < 6; last2++ )
- {
- for( int last3 = 0; last3 < 10; last3++ )
- {
- if( (array2[last2]->use == 1) && (last1 != last2) )
- {
- for( int last4 = 0; last4 < 6; last4++ )
- {
- if( array2[last1]->set2[last2] == array2[last3]->set2[last4] )
- {
- do {
- array2[last1]->set2[last2] = (1 + rand() % 51);
- } while( array2[last1]->set2[last2] < 1 ||
- array2[last1]->set2[last2] > 51 );
- }
- }
- }
- }
- }
- }
- }
-
-
- for( int ez1 = 0; ez1 < 10; ez1++ )
- {
- if( array2[ez1]->use == 0 )
- {
- for( int ez2 = 0; ez2 < 6; ez2++ )
- {
- for( int ez3 = 0; ez3 < 6; ez3++ )
- {
- if( (ez2 != ez3) && (array2[ez1]->set2[ez2] == array2[ez1]->set2[ez3]) )
- {
- do {
- array2[ez1]->set2[ez3] = (1 + rand() % 51);
- } while( array2[ez1]->set2[ez3] < 1 ||
- array2[ez1]->set2[ez3] > 51 );
- }
- }
- }
- }
- }
-
- int hold2 = 0; // another simple bubble sort here
-
-
- for( int pass15 = 0; pass15 < 10; pass15++ )
- {
- for( int pass16 = 0; pass16 < 6; pass16++ )
- {
- for( int d2 = 0; d2 < (6 - 1); d2++ )
- {
- if( array2[pass15]->set2[d2] > array2[pass15]->set2[d2+1] )
- {
- hold2 = array2[pass15]->set2[d2];
- array2[pass15]->set2[d2] = array2[pass15]->set2[d2 + 1];
- array2[pass15]->set2[d2 + 1] = hold2;
- }
- }
- }
- }
-
-
-
- // this counts the occurrances of numbers in the sets
- // count_array2[]:
- // 0 is ommitted to make count_array easier to understand
- // 52 is ommitted to make room for the NULL terminator in count_array
- index1 = 0;
- index2 = 0; // just to be sure
- for( int razz2 = 0; razz2 < 52; razz2++ )
- {
- count_array2[razz2] = NULL;
- }
-
- for( int razz3 = 0; razz3 < 10; razz3++ )
- {
- array2[razz3]->odds2 = NULL;
- array2[razz3]->evens2 = NULL;
- array2[razz3]->reds2 = NULL;
- array2[razz3]->whites2 = NULL;
- array2[razz3]->blues2 = NULL;
- }
-
- int theNumber = 0;
- for( index1 = 0; index1 < 10; index1++ )
- {
- for( index2 = 0; index2 < 6; index2++ )
- {
- theNumber = ( array2[index1]->set2[index2] );
- switch( theNumber )
- {
- case 1:
- {
- count_array2[1]++;
- array2[index1]->odds2++;
- (array2[index1]->reds2++);
- } continue;
-
- case 2:
- {
- count_array2[2]++;
- array2[index1]->evens2++;
- (array2[index1]->reds2++);
- } continue;
-
- case 3:
- {
- count_array2[3]++;
- array2[index1]->odds2++;
- (array2[index1]->reds2++);
- } continue;
-
- case 4:
- {
- count_array2[4]++;
- array2[index1]->evens2++;
- (array2[index1]->reds2++);
- } continue;
-
- case 5:
- {
- count_array2[5]++;
- array2[index1]->odds2++;
- (array2[index1]->reds2++);
- } continue;
-
- case 6:
- {
- count_array2[6]++;
- array2[index1]->evens2++;
- (array2[index1]->reds2++);
- } continue;
-
- case 7:
- {
- count_array2[7]++;
- array2[index1]->odds2++;
- (array2[index1]->reds2++);
- } continue;
-
- case 8:
- {
- count_array2[8]++;
- array2[index1]->evens2++;
- (array2[index1]->reds2++);
- } continue;
-
- case 9:
- {
- count_array2[9]++;
- array2[index1]->odds2++;
- (array2[index1]->reds2++);
- } continue;
-
- case 10:
- {
- count_array2[10]++;
- array2[index1]->evens2++;
- (array2[index1]->reds2++);
- } continue;
-
- case 11:
- {
- count_array2[11]++;
- array2[index1]->odds2++;
- (array2[index1]->reds2++);
- } continue;
-
- case 12:
- {
- count_array2[12]++;
- array2[index1]->evens2++;
- (array2[index1]->reds2++);
- } continue;
-
- case 13:
- {
- count_array2[13]++;
- array2[index1]->odds2++;
- (array2[index1]->reds2++);
- } continue;
-
- case 14:
- {
- count_array2[14]++;
- array2[index1]->evens2++;
- (array2[index1]->reds2++);
- } continue;
-
- case 15:
- {
- count_array2[15]++;
- array2[index1]->odds2++;
- (array2[index1]->reds2++);
- } continue;
-
- case 16:
- {
- count_array2[16]++;
- array2[index1]->evens2++;
- (array2[index1]->reds2++);
- } continue;
-
- case 17:
- {
- count_array2[17]++;
- array2[index1]->odds2++;
- (array2[index1]->reds2++);
- } continue;
- // end of reds
- case 18:
- {
- count_array2[18]++;
- array2[index1]->evens2++;
- (array2[index1]->whites2++);
- } continue;
-
- case 19:
- {
- count_array2[19]++;
- array2[index1]->odds2++;
- (array2[index1]->whites2++);
- } continue;
-
- case 20:
- {
- count_array2[20]++;
- array2[index1]->evens2++;
- (array2[index1]->whites2++);
- } continue;
-
- case 21:
- {
- count_array2[21]++;
- array2[index1]->odds2++;
- (array2[index1]->whites2++);
- } continue;
-
- case 22:
- {
- count_array2[22]++;
- array2[index1]->evens2++;
- (array2[index1]->whites2++);
- } continue;
-
- case 23:
- {
- count_array2[23]++;
- array2[index1]->odds2++;
- (array2[index1]->whites2++);
- } continue;
-
- case 24:
- {
- count_array2[24]++;
- array2[index1]->evens2++;
- (array2[index1]->whites2++);
- } continue;
-
- case 25:
- {
- count_array2[25]++;
- array2[index1]->odds2++;
- (array2[index1]->whites2++);
- } continue;
-
- case 26:
- {
- count_array2[26]++;
- array2[index1]->evens2++;
- (array2[index1]->whites2++);
- } continue;
-
- case 27:
- {
- count_array2[27]++;
- array2[index1]->odds2++;
- (array2[index1]->whites2++);
- } continue;
-
- case 28:
- {
- count_array2[28]++;
- array2[index1]->evens2++;
- (array2[index1]->whites2++);
- } continue;
-
- case 29:
- {
- count_array2[29]++;
- array2[index1]->odds2++;
- (array2[index1]->whites2++);
- } continue;
-
- case 30:
- {
- count_array2[30]++;
- array2[index1]->evens2++;
- (array2[index1]->whites2++);
- } continue;
-
- case 31:
- {
- count_array2[31]++;
- array2[index1]->odds2++;
- (array2[index1]->whites2++);
- } continue;
-
- case 32:
- {
- count_array2[32]++;
- array2[index1]->evens2++;
- (array2[index1]->whites2++);
- } continue;
-
- case 33:
- {
- count_array2[33]++;
- array2[index1]->odds2++;
- (array2[index1]->whites2++);
- } continue;
-
- case 34:
- {
- count_array2[34]++;
- array2[index1]->evens2++;
- (array2[index1]->whites2++);
- } continue;
- // end of whites
- case 35:
- {
- count_array2[35]++;
- array2[index1]->odds2++;
- (array2[index1]->blues2++);
- } continue;
-
- case 36:
- {
- count_array2[36]++;
- array2[index1]->evens2++;
- (array2[index1]->blues2++);
- } continue;
-
- case 37:
- {
- count_array2[37]++;
- array2[index1]->odds2++;
- (array2[index1]->blues2++);
- } continue;
-
- case 38:
- {
- count_array2[38]++;
- array2[index1]->evens2++;
- (array2[index1]->blues2++);
- } continue;
-
- case 39:
- {
- count_array2[39]++;
- array2[index1]->odds2++;
- (array2[index1]->blues2++);
- } continue;
-
- case 40:
- {
- count_array2[40]++;
- array2[index1]->evens2++;
- (array2[index1]->blues2++);
- } continue;
-
- case 41:
- {
- count_array2[41]++;
- array2[index1]->odds2++;
- (array2[index1]->blues2++);
- } continue;
-
- case 42:
- {
- count_array2[42]++;
- array2[index1]->evens2++;
- (array2[index1]->blues2++);
- } continue;
-
- case 43:
- {
- count_array2[43]++;
- array2[index1]->odds2++;
- (array2[index1]->blues2++);
- } continue;
-
- case 44:
- {
- count_array2[44]++;
- array2[index1]->evens2++;
- (array2[index1]->blues2++);
- } continue;
-
- case 45:
- {
- count_array2[45]++;
- array2[index1]->odds2++;
- (array2[index1]->blues2++);
- } continue;
-
- case 46:
- {
- count_array2[46]++;
- array2[index1]->evens2++;
- (array2[index1]->blues2++);
- } continue;
-
- case 47:
- {
- count_array2[47]++;
- array2[index1]->odds2++;
- (array2[index1]->blues2++);
- } continue;
-
- case 48:
- {
- count_array2[48]++;
- array2[index1]->evens2++;
- (array2[index1]->blues2++);
- } continue;
-
- case 49:
- {
- count_array2[49]++;
- array2[index1]->odds2++;
- (array2[index1]->blues2++);
- } continue;
-
- case 50:
- {
- count_array2[50]++;
- array2[index1]->evens2++;
- (array2[index1]->blues2++);
- } continue;
-
- case 51:
- {
- count_array2[51]++;
- array2[index1]->odds2++;
- (array2[index1]->blues2++);
- } continue;
-
- default:
- {
- break;
- }
- }
- }
- }
-
-
-
- int index62;
- int temp2;
- for( index62 = 0; index62 < 10; index62++ )
- {
- temp2 = 0;
- temp2 += (array2[index62]->set2[1] - array2[index62]->set2[0]);
- temp2 += (array2[index62]->set2[2] - array2[index62]->set2[1]);
- temp2 += (array2[index62]->set2[3] - array2[index62]->set2[2]);
- temp2 += (array2[index62]->set2[4] - array2[index62]->set2[3]);
- temp2 += (array2[index62]->set2[5] - array2[index62]->set2[4]);
-
- array2[index62]->sum_of_diffs2 = temp2;
- }
-
- int index72;
- for( index72 = 0; index72 < 10; index72++ )
- {
- float sum2 = 0;
- int summer2 = 0;
-
- for( summer2 = 0; summer2 < 6; summer2++ )
- {
- sum2 += array2[index72]->set2[summer2];
- }
- array2[index72]->average2 = (( sum2 / 6 ) + .5);
- }
-
-
- cout << endl << endl << endl << endl << endl << endl;
- cout << "Possible Alternates:" << endl << endl;
-
- int numcnt = 0;
- // print out the alternates
-
- numcnt = 5;
- for( int prt1 = 0; prt1 < 10; prt1++ )
- {
- if( array2[prt1]->use == 0 )
- {
- numcnt++;
- cout << "Set #" << numcnt << " ** ";
- for( int prt2 = 0; prt2 < 6; prt2++ )
- {
- cout << (array2[prt1]->set2[prt2]) << ' ';
- }
- cout << " **" << endl;
-
- cout << "Odds: " << array2[prt1]->odds2 << ' ' << ' ';
- cout << "Evens: " << array2[prt1]->evens2 << ' ' << ' ';
- cout << "Whites: " << array2[prt1]->whites2 << ' ' << ' ';
- cout << "Blues: " << array2[prt1]->blues2 << ' ' << ' ';
- cout << "Reds: " << array2[prt1]->reds2 << endl;
- cout << "Average: " << array2[prt1]->average2 << ' ' << ' ';
- cout << "Sum Of Differences: " << array2[prt1]->sum_of_diffs2 << ' ' << ' ';
- cout << endl << " Distribution Matches: ";
- for( int dis1 = 0; dis1 < 6; dis1++ )
- {
- cout << count_array[(array2[prt1]->set2[dis1])] << ' ';
- }
- cout << endl << endl << endl;
- }
- }
-
- cout << " ===***********************===" << endl;
- cout << endl << endl << endl << endl;
-
-
- cout << "Here are 5 number sets to use in the next draw: " << endl << endl;
-
- numcnt = 0;
- for( int prt1 = 0; prt1 < 10; prt1++ )
- {
- if( array2[prt1]->use == 1 )
- {
- numcnt++;
- cout << "Set #" << numcnt << " ** ";
- for( int prt2 = 0; prt2 < 6; prt2++ )
- {
- cout << (array2[prt1]->set2[prt2]) << ' ';
- }
- cout << " **" << endl;
-
- cout << "Odds: " << array2[prt1]->odds2 << ' ' << ' ';
- cout << "Evens: " << array2[prt1]->evens2 << ' ' << ' ';
- cout << "Whites: " << array2[prt1]->whites2 << ' ' << ' ';
- cout << "Blues: " << array2[prt1]->blues2 << ' ' << ' ';
- cout << "Reds: " << array2[prt1]->reds2 << endl;
- cout << "Average: " << array2[prt1]->average2 << ' ' << ' ';
- cout << "Sum Of Differences: " << array2[prt1]->sum_of_diffs2 << ' ' << ' ';
- cout << endl << " Distribution Matches: ";
- for( int dis1 = 0; dis1 < 6; dis1++ )
- {
- cout << count_array[(array2[prt1]->set2[dis1])] << ' ';
- }
- cout << endl << endl;
- }
- }
-
- cout << "Now you can print or save the results!" << endl;
- cout << "I make no claim that you will win any prize!" << endl;
- cout << "This program is for entertainment purposes only!" << endl;
- exit( 0 );
- }
-
-
-